import Config from './config.js'
import { getToken, setToken, removeToken, refreshToken } from '@/common/auth'

export async function a() 
{
	console.log('a')
}

export async function b() 
{
	console.log('b')
	
}

export async function c() 
{
	console.log('c')
	
}

function inArray(value, arr) 
{
	for(var i=0; i < arr.length; i++){
		if(value === arr[i]){
			return true;
		}
	}
	return false;
}

function setTitleNViewStyle(index, show,text) {  
    let pages = getCurrentPages();  
    let page = pages[pages.length - 1];  
    // #ifdef APP-PLUS  
    let currentWebview = page.$getAppWebview();  
    if(show){  
        if(index === 0){  
            currentWebview.showTitleNViewButtonRedDot({index:index,text:text})  
        }else{  
            currentWebview.showTitleNViewButtonRedDot({index:index,text:text})  
        }  
    }else{  
        if(index === 0){  
            currentWebview.hideTitleNViewButtonRedDot({index:index})  
        }else{  
            currentWebview.removeTitleNViewButtonBadge({index:index})  
        }  
    }  
    // #endif  

    // #ifdef H5  
	try{
		if(show){  
			
			if(index === 0){  
				document.querySelector('.uni-page-head-hd .uni-page-head-btn')[1].classList.add('uni-page-head-btn-red-dot');  
			} else {  
				document.querySelectorAll('.uni-page-head-ft .uni-page-head-btn')[index].classList.add('uni-page-head-btn-red-dot');  
			}  
		} else {  
			if(index === 0){  
				document.querySelector('.uni-page-head-btn-red-dot').classList.remove('uni-page-head-btn-red-dot');  
			} else {  
				document.querySelectorAll('.uni-page-head-ft .uni-page-head-btn')[index].classList.remove('uni-page-head-btn-red-dot');  
			}  
		}  
	}catch(e){}
    // #endif  
} 

module.exports = {
	setTitleNViewStyle: setTitleNViewStyle,
	inArray: inArray
}
